added samples
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2010 / VBAzureXbap / WCFServiceWebRole / WebRole.vb
blob02c4be6c2b2ff2d372390fa9498f6d6d3dbb38df
1 Imports System
2 Imports System.Collections.Generic
3 Imports System.Linq
4 Imports Microsoft.WindowsAzure
5 Imports Microsoft.WindowsAzure.Diagnostics
6 Imports Microsoft.WindowsAzure.ServiceRuntime
8 Public Class WebRole
9 Inherits RoleEntryPoint
11 Public Overrides Function OnStart() As Boolean
13 DiagnosticMonitor.Start("DiagnosticsConnectionString")
15 ' For information on handling configuration changes
16 ' see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
17 AddHandler RoleEnvironment.Changing, AddressOf RoleEnvironmentChanging
19 Return MyBase.OnStart()
21 End Function
23 Private Sub RoleEnvironmentChanging(ByVal sender As Object, ByVal e As RoleEnvironmentChangingEventArgs)
25 ' If a configuration setting is changing
26 If (e.Changes.Any(Function(change) TypeOf change Is RoleEnvironmentConfigurationSettingChange)) Then
27 ' Set e.Cancel to true to restart this role instance
28 e.Cancel = True
29 End If
31 End Sub
33 End Class